﻿
class DefaultInitGrid implements IInitGrid {
    Execute(grid: IGrid) {
        for (var x = 0; x < grid.Width; x++) {
            for (var y = 0; y < grid.Height; y++) {
                var cell = grid.GetCellRaw(x, y);
                var state = CellState.Dead; 
                var random = Math.random();
                if (random > 0.85)
                    state = CellState.Alive;
                cell.InitCell(grid, state, x, y);
            }
        }
    }
}